Skip to content

fix: site write access must not implicitly grant CONFIG write#306

Merged
kptdobe merged 2 commits into
mainfrom
fix/config-write-requires-explicit-grant
Jul 22, 2026
Merged

fix: site write access must not implicitly grant CONFIG write#306
kptdobe merged 2 commits into
mainfrom
fix/config-write-requires-explicit-grant

Conversation

@kptdobe

@kptdobe kptdobe commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Description

An author granted with writes access on the content can write the site config. Problem is that the config contains the library and apps extension points: an author can add an external url containing a malicious code - an author would then open the library and apps and auth token might leak.

One mitigation is to only allow trusted users to edit the site config and secure it by default (read only which is required for features to work).

This is a breaking change and we might advertise it as soon as it is merged. Instructions to authors would be to ask permissions to their org owners who would add the /site/CONFIG write entry to the org config.

Summary

  • /site/CONFIG was reachable via any /site/** or /site/+** write rule, so anyone with recursive write on site content could also write the site's config.
  • getUserActions now caps actions to read when a match against a CONFIG keyword target (CONFIG or /{site}/CONFIG) comes from a wildcard/recursive rule rather than a rule targeting the keyword itself.
  • Read access on CONFIG is unaffected — still implied by any matching site/org rule.
  • Write on CONFIG now requires an explicit rule on the CONFIG (org) or /{site}/CONFIG (site) keyword with write in org config.

Test plan

  • npm run lint
  • npm test (476 passing)
  • Updated test/utils/auth.test.js — flipped the assertion that documented the old wildcard-write-leak behavior, added a case proving explicit /mysite/CONFIG write rules still grant write

/site/CONFIG was reachable via any /site/** or /site/+** write rule,
so anyone with write access to content could also write the config.
Config write now requires an explicit rule targeting the CONFIG
keyword itself (site or org level); wildcard/recursive site rules
still imply CONFIG read.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/utils/auth.js 95.83% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@kptdobe
kptdobe requested review from bosschaert and tripodsan July 21, 2026 13:58
getAclCtx() built its cached actionSet for a config request by looking up
only the site-specific /{site}/CONFIG keyword, never the org-level CONFIG
keyword. hasConfigPermission() in the config route ORs both, so a user
holding only the org-level CONFIG rule could actually POST/GET config, but
the actionSet exposed via the X-da-actions/X-da-child-actions headers
lacked write - permanently locking the config editor UI for that user once
the document existed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@kptdobe
kptdobe merged commit 9545ea2 into main Jul 22, 2026
5 checks passed
@kptdobe
kptdobe deleted the fix/config-write-requires-explicit-grant branch July 22, 2026 10:07
adobe-bot pushed a commit that referenced this pull request Jul 22, 2026
## [1.13.2](v1.13.1...v1.13.2) (2026-07-22)

### Bug Fixes

* site write access must not implicitly grant CONFIG write ([#306](#306)) ([9545ea2](9545ea2))
@adobe-bot

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 1.13.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants